package campus.controller;


import campus.dao.ManagerDao;
import campus.model.Manager;
import campus.service.ManagerService;
import campus.util.ErrorUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RequestMapping("/manager/")
@Controller
public class ManagerController {

    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private ManagerDao managerDao;
    @Autowired
    private ManagerService managerService;

    @RequestMapping(value="loginManager",method= RequestMethod.POST)
    @ResponseBody
    public Map<String,Object> loginManager(HttpServletRequest request){
        String managername = request.getParameter("managername");
        String managerpwd = request.getParameter("managerpwd");
        Map<String,Object> map= managerService.loginManager(managername,managerpwd);
        return map;

    }


}
